Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sm/simplify-message-imports #358

Merged
merged 13 commits into from
Dec 14, 2023
Merged

Sm/simplify-message-imports #358

merged 13 commits into from
Dec 14, 2023

Conversation

mshanemc
Copy link
Contributor

@mshanemc mshanemc commented Dec 8, 2023

forcedotcom/sfdx-core#1003 makes this possible.

This willl help roll it out everywhere.

@W-14626332@

CI 🔴 🟢 explanation:
the ones with --fix in the name are the "what would happen when devScripts runs lint --fix everywhere.
the ones without --fix fail when any change would be made (helps verify the expected errors are thrown)
packaging is green for both because it's not on ESM

This PR also moves the linter rules to eslint6 to align with everything else. There were some deprecations, including the method for getting sourceCode for the file, which is a lot of the PR noise.

the API changed some for the rule config (error, warn) => (recommended, strict, stylistic)
the imports/utils all got reorganized because (I think ESM, or at least module:node16 etc)

@@ -0,0 +1,101 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, the actual rule that led to this PR

@mdonnalley
Copy link
Contributor

mdonnalley commented Dec 14, 2023

QA:

(used 1.16.16-qa.0 in plugin-packaging esm branch, which already uses importMessagesDirectoryFromImportMetaUrl)

🟢 existing uses of importMessagesDirectoryFromImportMetaUrl pass linter
🟢 changing back to Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url))); causes lint failure
🟢 yarn lint -- --fix changes to preferred method
🟢 import path, { dirname } from 'node:path'; is handled
🟢 import path and path.dirname is handled
🟢 import url, { fileURLToPath } from 'node:url'; is handled
🔴 The following passes linter and is not fixed

import { dirname } from 'node:path';
import url from 'node:url';

Messages.importMessagesDirectory(dirname(url.fileURLToPath(import.meta.url)));

@mdonnalley mdonnalley merged commit 9a4f426 into main Dec 14, 2023
7 checks passed
@mdonnalley mdonnalley deleted the sm/simplify-message-imports branch December 14, 2023 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants